# uncompyle6 version 3.2.3
# Python bytecode 3.6 (3379)
# Decompiled from: Python 3.6.8 |Anaconda custom (64-bit)| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)]
# Embedded file name: site-packages\PyInstaller\utils\hooks\win32.py
from ..hooks import exec_statement


def get_pywin32_module_file_attribute(module_name):
    """
    Get the absolute path of the PyWin32 DLL specific to the PyWin32 module
    with the passed name.
    
    On import, each PyWin32 module:
    
    * Imports a DLL specific to that module.
    * Overwrites the values of all module attributes with values specific to
      that DLL. This includes that module's `__file__` attribute, which then
      provides the absolute path of that DLL.
    
    This function safely imports that module in a PyWin32-aware subprocess and
    returns the value of that module's `__file__` attribute.
    
    Parameters
    ----------
    module_name : str
        Fully-qualified name of that module.
    
    Returns
    ----------
    str
        Absolute path of that DLL.
    
    See Also
    ----------
    `PyInstaller.utils.win32.winutils.import_pywin32_module()`
        For further details.
    """
    statement = "\n        from PyInstaller.utils.win32 import winutils\n        module = winutils.import_pywin32_module('%s')\n        print(module.__file__)\n    "
    return exec_statement(statement % module_name)


__all__ = ("get_pywin32_module_file_attribute",)
